/**
 * Copyright (c) Software Institude of PKU
 * All rights reserved. 
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 */
package edu.pku.sei.modeler.model.uml.CompleteActions;
// imports:
import org.w3c.dom.Element;

import edu.pku.sei.gefcommon.descriptor.annotation.MethodProperty;
import edu.pku.sei.modeler.model.common.*;
import edu.pku.sei.modeler.model.core.*;
import edu.pku.sei.modeler.model.xml.XMLUtility;

import edu.pku.sei.modeler.model.uml.Communications.Trigger;
import edu.pku.sei.modeler.model.uml.BasicActions.OutputPin;

import edu.pku.sei.modeler.model.uml.FundamentalActivities.Action;
import edu.pku.sei.modeler.uml.modelHelper.ModelPackage;

/**
 * @generated
 *
 */
public class AcceptEventAction extends Action implements IAcceptEventAction {
	// attributes
	
	protected boolean isUnmarshall;
	
	
	
	
	// references
	
	protected MetaTypedList trigger;
	
	protected MetaTypedList result;
	
	
	
	// getters & setters for attributes
	
	@MethodProperty(
			id = "ACCEPTEVENTACTION_ISUNMARSHALL",
			catalog = "Model",
			name = ModelPackage.ACCEPTEVENTACTION_ISUNMARSHALL,
			setter = "setisUnmarshall"
			)
	
	public boolean getIsUnmarshall() {
		return isUnmarshall;
	}
	public void setIsUnmarshall(boolean newIsUnmarshall) {
		boolean oldisUnmarshall = isUnmarshall;
		isUnmarshall = newIsUnmarshall;
		firePropertyChange(ModelPackage.ACCEPTEVENTACTION_ISUNMARSHALL, oldisUnmarshall, newIsUnmarshall);
	}
	
	// getters for references
	
	public MetaTypedList getTrigger() {
		if(trigger == null) {
			trigger = new MetaTypedList(Trigger.class, this, ModelPackage.ACCEPTEVENTACTION_TRIGGER);
		}
		return trigger;
	}
	
	public MetaTypedList getResult() {
		if(result == null) {
			result = new MetaTypedList(OutputPin.class, this, ModelPackage.ACCEPTEVENTACTION_RESULT);
		}
		return result;
	}
	
	// save & load
	public void serialize(Element root) {
		super.serialize(root);
		// attributes
		
		XMLUtility.xmlInstance.serializeAttribute(root, ModelPackage.ACCEPTEVENTACTION_ISUNMARSHALL, isUnmarshall);
		
		// references
		
		XMLUtility.xmlInstance.serializeNodes(root, ModelPackage.ACCEPTEVENTACTION_TRIGGER, trigger);
		
		XMLUtility.xmlInstance.serializeNodes(root, ModelPackage.ACCEPTEVENTACTION_RESULT, result);
		
	}
	
	public void deSerialize(Element root) {
		super.deSerialize(root);
		// attributes
		
		isUnmarshall = XMLUtility.xmlInstance.deSerializeBoolean(root, ModelPackage.ACCEPTEVENTACTION_ISUNMARSHALL);
		
		// references
		
		this.getTrigger().addAll(XMLUtility.xmlInstance.deSerializeNodes(root, ModelPackage.ACCEPTEVENTACTION_TRIGGER));
		
		this.getResult().addAll(XMLUtility.xmlInstance.deSerializeNodes(root, ModelPackage.ACCEPTEVENTACTION_RESULT));
		
	}
	
	public void dynamicSet(String featureID, Object value) {
		if(featureID == null || "".equals(featureID)) {
			return;
		}
		// attributes
		
		// references
		
		else
			super.dynamicSet(featureID, value);
	}
}
 
 
 
 
 